Copyright @ 11/95 by Tracy L. Hinshaw. All rights reserved.
What They Are:
ReadStyled and WriteStyled are XFCN's for SuperCard® that allow you to exchange styled text between external files and your SuperCard® project. ReadStyled and WriteStyled are compatible with the SimpleText file format so that they may be used in conjunction with any styled-text editor.
ReadStyled and WriteStyled XFCN's are shareware. If you use these externals in your personal/shareware/freeware projects, please send $15.00 U.S. (or equivalent international currency) to:
Tracy L. Hinshaw
Parnassien Language Software
P.O. Box 142
Kellogg, IA 50135 U.S.A.
If you intend to include these externals in shareware/freeware applications or in any other commercial product, please contact the author for licensing/distribution information and approval at the above address or by email at:
parnassien@netins.net
Syntax:
ReadStyled:
get ReadStyled(Filename,fieldID,CardID,WindowID,IsCardField)
•filename = complete path to import file
•FieldID = the SHORT ID of the field to hold the text
•CardID = the SHORT ID of the card to hold the field
•WindowID = the SHORT ID of the window to hold the card
•IsCardField = [TRUE/FALSE] is the fld a card field?
Return Values: ReadStyled returns a two-lined result:
•first line:
0 = no errors within the XFCN
-1 = invalid path — no such field | card | window found
-2 = file empty; nothing read
-3 = invalid parameter count
•second line:
Copyright information
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
WriteStyled:
get WriteStyled(Filename,fieldID,CardID,WindowID,IsCardField,[Creator])
•filename = complete path to export file
•FieldID = the SHORT ID of the field holding the text
•CardID = the SHORT ID of the card holding the field
•WindowID = the SHORT ID of the window holding the card
•IsCardField = [TRUE/FALSE] is the fld a card field?
•Creator = [optional] The 4 character creator type of the new file.
(default is "ttxt". My favourite? "TBB6" = Tom Bender's
Tex-Edit Plus.)
Return Values: WriteStyled returns a two-lined result:
•first line:
0 = no errors within the XFCN
-1 = invalid path — no such field | card | window found
-2 = file empty; nothing written
-3 = invalid parameter count
•second line:
Copyright information
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What They Do and What They Don't Do
•Card fields; Background fields; hidden fields... ReadStyled and WriteStyled XFCN's work with both card and background fields. The "locktext" property of the target fields need not be set to false for ReadStyled and WriteStyled to work - they'll take care of that. Fields do need to be visible however and they do need to be on the current card. ReadStyled and WriteStyled cannot work with fields that have been hidden or that reside on different cards or in different windows.
•File Types... ReadStyled and WriteStyled are compatible only with files that use 'styl' resources to hold style information (such as those created by SimpleText or Tex-Edit Plus). Many commercial word processors treat styled text in their own way (i.e.: Microsoft Word) and consequently, files created by these applications will not retain style attributes when processed by ReadStyled. Of course, ReadStyled is always compatible with files created by WriteStyled.
•CardID, FieldID, WindowID... It is necessary that you send "the short ID" to the XFCN. If you send "the id" or "the long id" the XFCN's will fail. (See the demo scripts if you're unsure as to how to indicate this in your scripts).
•Large files; files with several styles... Unfortunately, ReadStyled and WriteStyled can currently only handle files containing up to 32000 characters. The larger the files, of course, the longer it will take for ReadStyled and WriteStyled to process their style information and the more memory they will require to operated comfortably. ReadStyled and WriteStyled were created and tested primarily on a Macintosh LC with 4 MB RAM (yes, people really do still use them). Large files or files containing complicated or an unusually large number of style "runs" have been known to take as long as 25 seconds to process. As is the case with every program, the more memory installed and the faster your machine, the more pleasant your experience with ReadStyled and WriteStyled will be.
•The LockScreen... ReadStyled and WriteStyled don't "lock the screen" as they work. As a result, you may see a "flash" or two as they replace or read the text in your target field. This can be distracting but is easily treated by simply using "lock screen" - "unlock screen" before and after the XFCN calls.
•Cursors... ReadStyled and WriteStyled don't choose a cursor state when running. This was done so as not to interfere with any customized cursors the user may prefer. You may want to at least set the cursor to "watch" before the XFCN call - especially if using one of the large files described above.
•Global Variables... ReadStyled and WriteStyled work only with fields and cannot store styled information in global variables.
•Palettes; floating windows and mutiple projects... ReadStyled and WriteStyled will work with palette style windows if the current project owns the top-most window. Example: If the only opened window of your project is a palette AND you have another palette window opened from a second project (i.e.: the colour palette from the Runtime Editor) - the XFCN's WILL NOT WORK because in this case, the Runtime Editor owns the topmost window. This will probably never come up but if it does, just make sure that your project owns the "top window."
•File Creators... WriteStyled allows you to specify a file creator for new files. This is the last parameter and should be the correct four-character creator type (i.e.: Tex-Edit Plus = "TBB6"). The default is SimpleText ("ttxt"). Note that this is also the creator type for SimpleText's earlier incarnation "TeachText." If TeachText opens files created by WriteStyled, style information will not be displayed.
•Clipboard... ReadStyled and WriteStyled use the same memory as the clipboard. Don't run the XFCN's if you have anything important in the clipboard because ReadStyled and WriteStyled both clear it before executing.
Mumbo-Jumbo and Other Legal Stuff
The ReadStyled and WriteStyled package and each of its components are provided AS IS. No guarantee or warranty, express or implied, is made on the operation of this product, or its suitability for any task. In no event shall the programmer, Tracy L. Hinshaw, or his suppliers be liable for any damages whatsoever (including, without limitation, damage for loss of profit, business interruption, loss of information, or other pecuniary loss) arising out of the use, misuse of or inability to use this product.
The author, Tracy L. Hinshaw, disclaims all other warranties either expressed or implied, including, but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to the product.